﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class ElseStatementElement : StatementElement
    {
        private StatementElement statement;

        public StatementElement Statement { get { return statement; } set { statement = value; } }

        public ElseStatementElement(TokenInfo StartInfo, StatementElement Statement, List<TokenInfo> Comments)
            : base(StartInfo, Comments)
        {
            statement = Statement;
        }

        public override string ToString()
        {
            return string.Format("else {0}", statement);
        }

        protected override IEnumerator<ISyntaxTreeElement> CreateEnumerator()
        {
            yield return statement;
        }
    }
}
